<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>09-HUTECH</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        

    </h:head>
    <h:body>
        <ui:composition template="/common/template.xhtml">
            <ui:define name="left">
                 <p:growl id="message" showDetail="true"  life="300"/>
                   <p:menu model="#{cateController.model}" style="min-height: 500px;" />  
            </ui:define>
            <ui:define name="right">
             <p:dataGrid columns="3"  value="#{productController.listProduct}" var="cate"  rows="12" paginator="true"  
        paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
        rowsPerPageTemplate="9,12,15"> 
                        <p:column>
                            <p:panel header="#{cate.product.name}"  styleClass="products" >
                                
                                <div class="img-product">
                                    <p:graphicImage value="#{appConstrant.IMAGE_SERVER_PATH}#{cate.image}" style="padding: 0px auto !important;width: 100%;"/>
                                </div>
                                <div class="down">
                                    <div class="price">
                                <h:outputText value="#{cate.price}">
                                    <f:convertNumber pattern="#000,000VNĐ" />
                                </h:outputText>
                                        <br/>
                                              </div>
                                    <br/>
                                     <div class="mua">
                                  <p:commandButton  value="Add to cart" action="#{cartController.addtoCart(cate)}" update=":form:liscart" process="@all" rendered="#{cusController.islogin()}"/>
                                <p:commandButton value="Detail"  action="#{productController.getdetail(cate.product)}"/>
                                 
                                    </div>
                                   
                                </div>
                              
                            </p:panel> 
                        </p:column>
             </p:dataGrid>
                
            </ui:define>
        </ui:composition>
    </h:body>
</html>
